home *** CD-ROM | disk | FTP | other *** search
/ Aminet 5 / Aminet 5 - March 1995.iso / Aminet / util / rexx / kj01.lha / kj01.fred
Text File  |  1994-12-23  |  20KB  |  846 lines

  1. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  2. o_ SNIP     o_ SNIP     o_ SNIP     o_ SNIP     o_ SNIP     o_ SNIP     o_
  3. o\     SNIP o\     SNIP o\     SNIP o\     SNIP o\     SNIP o\     SNIP o\
  4. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  5.  
  6. /*
  7.  ** SaveToSANYO.fred
  8.  **
  9.  ** $VER: SaveToSANYO.fred 1.0.0 (20.12.94)
  10.  **
  11.  ** See SaveToSANYO.fred.pre for complete documentation.
  12.  **
  13.  ** We don't care if there is any image data in the current 
  14.  ** buffer, since a previously called saver will have displayed 
  15.  ** it on graphics board already.
  16.  **
  17.  ** Clips Imported:
  18.  **        FREDSANTimeCode    -    Starting NDF SMPTE timecode
  19.  **        FREDSANSFlimit    -    Threshold value for the number of 
  20.  **                                single frame edits per cell 
  21.  **                                which will cause a single multi-
  22.  **                                frame APND
  23.  **
  24.  ** NOTE: Clip names are case sensitive.
  25.  **
  26.  ** This script requires FRED v1.4.0 (or higher) to run.  Also 
  27.  ** required is ADPro v2.5.0 (or higher).
  28.  **
  29.  ** Copyright 1994 SyntheToonz, Inc., Kenneth Jennings
  30.  ** All Rights Reserved
  31.  **
  32.  ** Internet: kenneth@daffy.aatech.com
  33.  */
  34.  
  35.  
  36. ADDRESS "ADPro"
  37. OPTIONS RESULTS
  38.  
  39. PARSE ARG FrameNum FrameFName Length LoadFlag FirstCallSeq FirstCallCell
  40.  
  41. NL = '0A'X
  42. SQ = '27'X
  43. DQ = '22'X
  44. TRUE  = 1
  45. FALSE = 0
  46.  
  47. NULLSTRING = DQ || DQ
  48.  
  49.  
  50. /*
  51.  ** Get the required clips.
  52.  */
  53.  
  54. TimeCode = GETCLIP( "FREDSANTimeCode" )
  55. IF (TimeCode = "") THEN DO
  56.     ADPRO_TO_FRONT
  57.     OKAY1 "Required clip, FREDSANTimeCode," || NL ||,
  58.         "is not specified."
  59.     SCREEN_TO_FRONT "FRED"
  60.     EXIT 10
  61. END
  62.  
  63. SFlimit = GETCLIP( "FREDSANSFlimit" )
  64. IF (SFlimit = "") THEN DO
  65.     ADPRO_TO_FRONT
  66.     OKAY1 "Required clip, FREDSANSFlimit," || NL ||,
  67.         "is not specified."
  68.     SCREEN_TO_FRONT "FRED"
  69.     EXIT 10
  70. END
  71.  
  72.  
  73. /*
  74.  ** Try to startup the AREXX communications handler
  75.  */
  76.  
  77. RXPort = StartRXComm()
  78.  
  79. IF (RXPort = NULLSTRING) THEN DO
  80.     ADPRO_TO_FRONT
  81.     OKAY1 "Unable to start ARexx" || NL ||,
  82.         "communications handler."
  83.     SCREEN_TO_FRONT "FRED"
  84.     EXIT 10
  85. END
  86.  
  87.  
  88. /*
  89.  ** If this is frame 1 then send setup string 
  90.  ** and starting timecode to deck
  91.  */
  92.  
  93. IF (FirstCallSeq = 1) THEN DO
  94.     CmdString = RX SQ||ADDRESS RXPort DQ||'EDTP5;INIT;EDOT:'||TimeCode||DQ||SQ
  95.     ADDRESS 'COMMAND' CmdString
  96. END
  97.  
  98.  
  99. /*
  100.  ** If frame count per cell is less than the single
  101.  ** frame edit threshold then loop for each edit.
  102.  **
  103.  ** Met or exceeded threshold means we do a single 
  104.  ** edit for the multiple frames in this cell.
  105.  */
  106.  
  107. IF (Length < SFlimit) THEN DO
  108.     Count = 1
  109.  
  110.     DO WHILE (Count <= Length)
  111.         CmdString = RX SQ||ADDRESS RXPort DQ||'APND 1'||DQ||SQ
  112.         ADDRESS 'COMMAND' CmdString
  113.         Count = Count + 1
  114.     END
  115. END
  116. ELSE DO
  117.     CmdString = RX SQ||ADDRESS RXPort DQ||'APND '||Length||DQ||SQ
  118.     ADDRESS 'COMMAND' CmdString
  119. END
  120.  
  121.  
  122. EXIT 0
  123.  
  124.  
  125.  
  126. StartRXComm:
  127.     Handler1 = "SANARexxHandler"
  128.     Handler2 = "BCDARexxHandler"
  129.  
  130.     IF (EitherPort() = NULLSTRING) THEN
  131.         CALL StartProgram(Handler1)
  132.  
  133.     IF (EitherPort() = NULLSTRING) THEN
  134.         CALL StartProgram(Handler2)
  135.  
  136.     RETURN EitherPort()
  137.  
  138.  
  139.  
  140. StartProgram:
  141.     PARSE ARG ProgName
  142.  
  143.     Max_Seconds_To_Load = 3
  144.     Flag = FALSE
  145.  
  146.     TIME( 'R' )
  147.  
  148.     DO WHILE ( (TIME( 'E' ) < Max_Seconds_To_Load) & (EitherPort() = NULLSTRING))
  149.         IF (Flag = FALSE) THEN DO
  150.             CmdString = "Run <NIL: >NIL:" ProgName "-t30 -a"
  151.             ADDRESS 'COMMAND' CmdString 
  152.             Flag = TRUE
  153.         END
  154.         ADDRESS 'COMMAND' 'Wait 1'
  155.     END
  156.  
  157.     RETURN
  158.  
  159.  
  160.  
  161. EitherPort:
  162.     RXPort1  = "SANARexx.port"
  163.     RXPort2  = "BCDAREXX.PORT"
  164.  
  165.     IF (FindPort(RXPort1) ~= NULLSTRING) THEN
  166.         RETURN RXPort1
  167.  
  168.     IF (FindPort(RXPort2) ~= NULLSTRING) THEN
  169.         RETURN RXPort2
  170.  
  171.     RETURN NULLSTRING
  172.  
  173.  
  174.  
  175. FindPort:
  176.     PARSE ARG PortName
  177.  
  178.     IF ( SHOW( 'Ports', PortName ) = FALSE) THEN
  179.         RETURN NULLSTRING
  180.  
  181.     RETURN PortName
  182.  
  183.  
  184. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  185. o_ SNIP     o_ SNIP     o_ SNIP     o_ SNIP     o_ SNIP     o_ SNIP     o_
  186. o\     SNIP o\     SNIP o\     SNIP o\     SNIP o\     SNIP o\     SNIP o\
  187. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  188.  
  189. /*
  190.  ** SaveToSANYO.fred.pre
  191.  **
  192.  ** $VER: SaveToSANYO.fred.pre 1.0.0 (20.12.94)
  193.  **
  194.  ** SaveToSANYO.fred.pre documentation:
  195.  **
  196.  ** If the SaveToSANYO.fred script appears in the InvokeADPro 
  197.  ** list, this program will ask the user to select the 
  198.  ** starting NDF SMPTE timecode, and the single frame/multi-
  199.  ** frame edit threshold.
  200.  **
  201.  ** The SMPTE timecode validation is fairly unforgiving, since
  202.  ** it requires all the digits (including leading zeros) be 
  203.  ** present, but at least it prevents bogus values.  My excuse
  204.  ** is that I wrote it in ten minutes.
  205.  **
  206.  ** SaveToSANYO.fred documentation:
  207.  **
  208.  ** This program can be run from an InvokeADPro list to save 
  209.  ** images to the SANYO GVR-S950 (or compatible BCD equipment) 
  210.  ** single frame VTR.  Including this program automatically 
  211.  ** causes a pre script to be executed as well to ask the user 
  212.  ** to select the communication command filename, the starting 
  213.  ** timecode, and the single frame/multiple frame edit threshold.
  214.  **
  215.  ** Normally, multiple frames per cell will result in a single 
  216.  ** frame edit for each frame.  If the number of frames exceeds 
  217.  ** or equals the given threshold, then a single APND event will 
  218.  ** occur for the cell. We at SyntheToonz find this useful to 
  219.  ** make the 10 second (300 frame) static images at the beginning
  220.  ** and end of the animations which make editing from the ani-
  221.  ** mation master tape to another tape easier.  It is not a good 
  222.  ** idea to use the threshold to make pauses in the middle of a 
  223.  ** rolling animation.  In our experience, the video signal 
  224.  ** shifts and the quality visibly changes, and even with a TBC 
  225.  ** the video playback is still not stable.
  226.  **
  227.  ** Note: Communications with the deck is accomplished by sending 
  228.  ** commands to the ARexx port of another program which actually
  229.  ** handles talking to the deck.  The script will first try to 
  230.  ** locate the port SANARexx.port, and then the port 
  231.  ** BCDAREXX.PORT.  If neither port is located, then the program 
  232.  ** will first attempt to run the SANARexxHandler program, and 
  233.  ** then the BCDARexxHandler program.  Afterwards, the script 
  234.  ** will try to find one of the Arexx ports again.  If the script 
  235.  ** still fails, then the user is notified of the problem.
  236.  **
  237.  ** Note also: This program is tested on the SANYO GVR-S950 deck 
  238.  ** using the SANARexxHandler program.  While the documentation 
  239.  ** (based largely on information from BCD) says the ARexx port 
  240.  ** to use is called SANARexx.port, it really is BCDAREXX.PORT. 
  241.  ** Since I get the feeling SANYO is trying hard to SANYO-tize 
  242.  ** their documentation and supporting programs, I believe at 
  243.  ** some point in the future the ARexx port name will change to 
  244.  ** what is documented in their manual.
  245.  **
  246.  ** Those fluent in ARexx may wonder why the ARexx communication 
  247.  ** with the BCD/SANARexx.port is so convoluted.  The reason is, 
  248.  ** that after exhaustive testing, this is the only way the port 
  249.  ** would accept and process commands on our system.  The 
  250.  ** development system is an A2000 with a GVP 33MHz 040 with a 
  251.  ** Toaster.  We adamantly avoid running PD hacks or even the 
  252.  ** standard commodities on our system.  The ARexx communications 
  253.  ** work if a command is manually typed and executed in the Shell 
  254.  ** with the RX command.  The exact same command sent to the 
  255.  ** BCD/SANARexx.port from a script fails.  There is no error and 
  256.  ** no results, as if the command were diverted or suppressed 
  257.  ** before it reached the port.  Anyway, communication is 
  258.  ** accomplished by building a messy RX command string with the 
  259.  ** necessary embedded quotes and using the Shell to execute the 
  260.  ** generated command string.  This is messy, but at least it
  261.  ** works.
  262.  **
  263.  ** Clips Exported:
  264.  **        FREDSANTimeCode    -    Starting NDF SMPTE timecode
  265.  **        FREDSANSFlimit    -    Threshold value for the number of 
  266.  **                                single frame edits per cell 
  267.  **                                which will cause a single multi-
  268.  **                                frame APND
  269.  **
  270.  ** NOTE: Clip names are case sensitive.
  271.  **
  272.  ** This script requires FRED v1.4.0 (or higher) to run.  Also 
  273.  ** required is ADPro v2.5.0 (or higher).
  274.  **
  275.  ** Copyright 1994 SyntheToonz, Inc., Kenneth Jennings
  276.  ** All Rights Reserved
  277.  **
  278.  ** Internet: kenneth@daffy.aatech.com
  279.  */
  280.  
  281.  
  282. ADDRESS "ADPro"
  283. OPTIONS RESULTS
  284.  
  285. PARSE ARG NumberOfCells NumberOfFrames
  286.  
  287. NL = '0A'X
  288. SQ = '27'X
  289. DQ = '22'X
  290. TRUE  = 1
  291. FALSE = 0
  292.  
  293. NULLSTRING = DQ || DQ
  294. ValidTC = FALSE
  295.  
  296. ADPRO_TO_FRONT
  297.  
  298.  
  299. /*
  300.  ** Ask the user to enter the starting timecode.
  301.  */
  302.  
  303. TimeCode = "00:00:00:00"
  304.  
  305. DO loop=1 UNTIL (ValidTC = TRUE)
  306.     Message = "Enter starting NDF SMPTE" || NL || "timecode as HH:MM:SS:FF"
  307.     CALL "FREDSCRIPTS:FREDFunctions/GetAString" '"'Message'"' '"'TimeCode'"' TRUE
  308.  
  309.     TimeCode = RESULT
  310.  
  311.     IF (TimeCode = NULLSTRING) THEN
  312.         EXIT 10
  313.  
  314.     TimeCode = STRIP(TimeCode)
  315.  
  316.     IF (LENGTH(TimeCode) ~= 11) THEN DO
  317.         Message = "Invalid SMPTE TimeCode" || NL || "(Length)"
  318.         OKAY1 '"'Message'"'
  319.         ITERATE loop
  320.     END
  321.  
  322.     Sep1     = SUBSTR(TimeCode, 3, 1)
  323.     Sep2     = SUBSTR(TimeCode, 6, 1)
  324.     Sep3     = SUBSTR(TimeCode, 9, 1)
  325.  
  326.     IF (Sep1 ~= ':') | (Sep2 ~= ':') | (Sep3 ~= ':') THEN DO
  327.         Message = "Invalid SMPTE TimeCode" || NL || "(: separators)"
  328.         OKAY1 '"'Message'"'
  329.         ITERATE loop
  330.     END
  331.  
  332.     HHdigits = SUBSTR(TimeCode, 1, 2)
  333.     MMdigits = SUBSTR(TimeCode, 4, 2)
  334.     SSdigits = SUBSTR(TimeCode, 7, 2)
  335.     FFdigits = SUBSTR(TimeCode, 10,2)
  336.  
  337.     IF (ValidateSMPTEdigits(HHdigits, 0, 23, 'hours')   = FALSE) THEN
  338.         ITERATE loop
  339.  
  340.     IF (ValidateSMPTEdigits(MMdigits, 0, 59, "minutes") = FALSE) THEN
  341.         ITERATE loop
  342.  
  343.     IF (ValidateSMPTEdigits(SSdigits, 0, 59, "seconds") = FALSE) THEN
  344.         ITERATE loop
  345.  
  346.     IF (ValidateSMPTEdigits(FFdigits, 0, 29, "frames")  = FALSE) THEN
  347.         ITERATE loop
  348.  
  349.     ValidTC = TRUE
  350. END
  351.  
  352.  
  353. /*
  354.  ** Ask the user for the single frame edit limit threshold per cell.
  355.  */
  356.  
  357. CALL "FREDSCRIPTS:FREDFunctions/GetANumber" '"'"Enter Single Frame" || NL || "edit limit per cell"'"' 300 2 900 TRUE
  358. IF (RESULT = (2-1)) THEN
  359.     EXIT 10
  360. SFlimit = RESULT
  361.  
  362.  
  363. /*
  364.  ** Update the clips.
  365.  */
  366.  
  367. SETCLIP( "FREDSANTimeCode", TimeCode )
  368. SETCLIP( "FREDSANSFlimit", SFlimit )
  369.  
  370. EXIT 0
  371.  
  372.  
  373.  
  374. /*
  375.  ** Make sure a set of SMPTE digits is numeric and 
  376.  ** falls within the accepted range
  377.  */
  378.  
  379. ValidateSMPTEdigits:
  380.     PARSE ARG STRdigits, MINdigits, MAXdigits, sectionText
  381.  
  382.     IF ( DATATYPE(STRdigits, Numeric) = FALSE) THEN DO
  383.         Message = "Invalid SMPTE TimeCode" || NL ||,
  384.              "(" || sectionText STRdigits "not numeric)"
  385.         OKAY1 '"'Message'"'
  386.         return FALSE
  387.     END
  388.  
  389.     IF (STRdigits < MINdigits) THEN DO
  390.         Message = "Invalid SMPTE TimeCode" || NL ||,
  391.             "(" || sectionText STRdigits "<" MINdigits || ")"
  392.         OKAY1 '"'Message'"'
  393.         return FALSE
  394.     END
  395.  
  396.     IF (STRdigits > MAXdigits) THEN DO
  397.         Message = "Invalid SMPTE TimeCode" || NL ||,
  398.             "(" || sectionText STRdigits ">" MAXdigits || ")"
  399.         OKAY1 '"'Message'"'
  400.         return FALSE
  401.     END
  402.  
  403. return TRUE
  404.  
  405.  
  406.  
  407. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  408. o_ SNIP     o_ SNIP     o_ SNIP     o_ SNIP     o_ SNIP     o_ SNIP     o_
  409. o\     SNIP o\     SNIP o\     SNIP o\     SNIP o\     SNIP o\     SNIP o\
  410. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  411.  
  412. /*
  413.  ** SaveToVT_BUFFER.fred
  414.  **
  415.  ** $VER: SaveToVT_BUFFER.fred 1.0.0 (20.12.94)
  416.  **
  417.  ** This program can be run from an InvokeADPro list to save 
  418.  ** images to the Video Toaster display board.  Including this 
  419.  ** program automatically causes a .pre script to be executed as 
  420.  ** well (to select the DV channel and the Scale option).
  421.  **
  422.  ** Clips Imported:
  423.  **        FREDVTBuffer    -    Which Toaster DV channel to save the 
  424.  **                                image in
  425.  **                                    1 = DV1
  426.  **                                    2 = DV2
  427.  **        FREDVTScaleOpt    -    Scale option if image is not correct 
  428.  **                                the correct Toaster frame size
  429.  **                                    0 = Do nothing, 
  430.  **                                    1 = Scale to normal frame size
  431.  **                                    2 = Center on a backdrop
  432.  **
  433.  ** NOTE: Clip names are case sensitive.
  434.  **
  435.  ** This script requires FRED v1.4.0 (or higher) to run.  Also 
  436.  ** required is ADPro v2.5.0 (or higher).
  437.  **
  438.  ** Copyright 1994 SyntheToonz, Inc., Kenneth Jennings
  439.  ** All Rights Reserved
  440.  **
  441.  ** Internet: kenneth@daffy.aatech.com
  442.  */
  443.  
  444.  
  445. ADDRESS "ADPro"
  446. OPTIONS RESULTS
  447.  
  448.  
  449. PARSE ARG FrameNum FrameFName Length LoadFlag FirstCallSeq FirstCallCell
  450.  
  451.  
  452. NL = '0A'X
  453. SQ = '27'X
  454. DQ = '22'X
  455. TRUE  = 1
  456. FALSE = 0
  457. ToasterWidth = 752
  458. ToasterHeight = 480
  459.  
  460.  
  461. /*
  462.  ** Get the required clips.
  463.  */
  464.  
  465. ToasterDV = GETCLIP( "FREDVTBuffer" )
  466.  
  467. IF (ToasterDV = "") THEN DO
  468.     ADPRO_TO_FRONT
  469.     OKAY1 "Required clip, FREDVTBuffer," || NL ||,
  470.         "is not specified."
  471.     SCREEN_TO_FRONT "FRED"
  472.     EXIT 10
  473. END
  474.  
  475. ScaleOpt = GETCLIP( "FREDVTScaleOpt" )
  476.  
  477. IF (ScaleOpt = "") THEN DO
  478.     ADPRO_TO_FRONT
  479.     OKAY1 "Required clip, FREDVTScaleOpt," || NL ||,
  480.         "is not specified."
  481.     SCREEN_TO_FRONT "FRED"
  482.     EXIT 10
  483. END
  484.  
  485.  
  486. /*
  487.  ** Check to see if Toaster is running
  488.  */
  489.  
  490. IF (~SHOW( 'P', "ToasterARexx.port" )) THEN DO
  491.     ADPRO_TO_FRONT
  492.     OKAY1 "Switcher is not running!"
  493.     ADPRO_TO_BACK
  494.     EXIT 10
  495. END
  496.  
  497.  
  498. /*
  499.  ** See what type of data is loaded in ADPro/MorphPlus.
  500.  */
  501.  
  502. CALL "FREDSCRIPTS:FREDFunctions/CheckForRawImageData" TRUE
  503. IF (RESULT ~= 0) THEN DO
  504.     ADPRO_TO_FRONT
  505.     OKAY1 "No RAW image data in memory!"
  506.     ADPRO_TO_BACK
  507.     EXIT 10
  508. END
  509.  
  510.  
  511. /*
  512.  ** Check Image Size
  513.  */
  514.  
  515. XSIZE
  516. ImageWidth  = ADPRO_RESULT
  517.  
  518. YSIZE
  519. ImageHeight = ADPRO_RESULT
  520.  
  521. IF (ImageWidth ~= ToasterWidth) | (ImageHeight ~= ToasterHeight) THEN DO
  522.  
  523.     IF (ScaleOpt = 1) THEN DO
  524.         /*
  525.          ** MAKE it fit the Toaster frame buffer
  526.          */
  527.  
  528.         /*
  529.          ** Adjust the pixel aspect of the image.
  530.          */
  531.         OPERATOR "DEFINE_PXL_ASPECT" 22 26
  532.         IF (RC ~= 0) THEN DO
  533.             ADPRO_TO_FRONT
  534.             OKAY1 "Could not define pixel aspect ratio."
  535.             ADPRO_TO_BACK
  536.             EXIT 10
  537.         END
  538.  
  539.         /*
  540.          ** Scale the image to fill a ToasterWidth x ToasterHeight screen.
  541.          */
  542.         ABS_SCALE ToasterWidth ToasterHeight
  543.         IF (RC ~= 0) THEN DO
  544.             ADPRO_TO_FRONT
  545.             OKAY1 "Could not scale to Toaster frame size."
  546.             ADPRO_TO_BACK
  547.             EXIT 10
  548.         END
  549.  
  550.     END
  551.  
  552.     IF (ScaleOpt = 2) THEN DO
  553.         /*
  554.          ** CENTER the image on a backdrop
  555.          */
  556.  
  557.         /*
  558.          ** Save current image to TEMP
  559.          */
  560.         SAVER  "TEMP" "XXX" "RAW"
  561.         IF (RC ~= 0) THEN DO
  562.             ADPRO_TO_FRONT
  563.             OKAY1 "Could not save image to TEMP."
  564.             ADPRO_TO_BACK
  565.             EXIT 10
  566.         END
  567.  
  568.         /*
  569.          ** Load a solid backdrop of the correct size
  570.          */
  571.         LOADER "BACKDROP" "XXX" WIDTH ToasterWidth HEIGHT ToasterHeight COLOR FILL 40 40 100
  572.         IF (RC ~= 0) THEN DO
  573.             ADPRO_TO_FRONT
  574.             OKAY1 "Could not create a backdrop."
  575.             ADPRO_TO_BACK
  576.             EXIT 10
  577.         END
  578.  
  579.         /*
  580.          ** Load original image in center of backdrop
  581.          */
  582.         CenterX = (ToasterWidth / 2) - (ImageWidth / 2)
  583.         CenterY = (ToasterHeight / 2) - (ImageHeight / 2)
  584.  
  585.         LOADER "TEMP" "XXX" COMPOFFSET CenterX CenterY COMPMIX 100
  586.         IF (RC ~= 0) THEN DO
  587.             ADPRO_TO_FRONT
  588.             OKAY1 "Could not reload TEMP image."
  589.             ADPRO_TO_BACK
  590.             EXIT 10
  591.         END
  592.  
  593.     END
  594.  
  595. END
  596.  
  597.  
  598. /*
  599.  ** Send image to the display board.
  600.  */
  601.  
  602. SAVER "VT_BUFFER" "XXX" BUFFER ToasterDV
  603. IF (RC ~= 0) THEN DO
  604.     Why = ADPRO_RESULT
  605.     ADPRO_TO_FRONT
  606.     OKAY1 "VT_BUFFER save failed:" || NL || Why || NL ||,
  607.         "Argument Information:" || NL ||,
  608.         "BUFFER = " || ToasterDV
  609.     SCREEN_TO_FRONT "FRED"
  610.     EXIT 10
  611. END
  612.  
  613. EXIT 0
  614.  
  615.  
  616. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  617. o_ SNIP     o_ SNIP     o_ SNIP     o_ SNIP     o_ SNIP     o_ SNIP     o_
  618. o\     SNIP o\     SNIP o\     SNIP o\     SNIP o\     SNIP o\     SNIP o\
  619. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  620.  
  621. /*
  622.  ** SaveToVT_BUFFER.fred.pre
  623.  **
  624.  ** $VER: SaveToVT_BUFFER.fred.pre 1.0.0 (20.12.94)
  625.  **
  626.  ** If the SaveToVT_BUFFER.fred script appears in the InvokeADPro list,
  627.  ** this program will ask the user to select the DV channel to display
  628.  ** the image in, and the Scale option if the image isn't the correct size
  629.  ** for a Toaster frame/image.
  630.  **
  631.  ** Clips Exported:
  632.  **        FREDVTBuffer    -    Which Toaster DV channel to save the 
  633.  **                                image in
  634.  **                                    1 = DV1
  635.  **                                    2 = DV2
  636.  **        FREDVTScaleOpt    -    Scale option if image is not correct 
  637.  **                                the correct Toaster frame size
  638.  **                                    0 = Do nothing, 
  639.  **                                    1 = Scale to normal frame size
  640.  **                                    2 = Center on a backdrop
  641.  **
  642.  ** NOTE: Clip names are case sensitive.
  643.  **
  644.  ** This script requires FRED v1.4.0 (or higher) to run.  Also 
  645.  ** required is ADPro v2.5.0 (or higher).
  646.  **
  647.  ** Copyright 1994 SyntheToonz, Inc., Kenneth Jennings
  648.  ** All Rights Reserved
  649.  **
  650.  ** Internet: kenneth@daffy.aatech.com
  651.  */
  652.  
  653.  
  654. ADDRESS "ADPro"
  655. OPTIONS RESULTS
  656.  
  657. PARSE ARG NumberOfCells NumberOfFrames
  658.  
  659. NL = '0A'X
  660. SQ = '27'X
  661. DQ = '22'X
  662. TRUE  = 1
  663. FALSE = 0
  664.  
  665.  
  666. ADPRO_TO_FRONT
  667.  
  668.  
  669. /*
  670.  ** Ask how scaling (should it be necessary) will be done.
  671.  */
  672.  
  673. OKAYN '"SaveToVT_BUFFER.fred"',
  674.     '"If image is not 752 x 480:"',
  675.     '" As Is | Scale | Center | Cancel "'
  676.  
  677. IF (RC = 0) THEN DO
  678.     SCREEN_TO_FRONT "FRED"
  679.     EXIT 10
  680. END
  681.  
  682. ScaleOpt = RC - 1
  683.  
  684.  
  685. /*
  686.  ** Ask the user which Toaster DV channel to use.
  687.  */
  688.  
  689. OKAYN '"SaveToVT_BUFFER.fred"',
  690.     '"Display image in which Toaster DV channel?"',
  691.     '" DV1 | DV2 | Cancel "'
  692.  
  693. IF (RC = 0) THEN DO
  694.     SCREEN_TO_FRONT "FRED"
  695.     EXIT 10
  696. END
  697.  
  698. ToasterDV = RC
  699.  
  700.  
  701. SCREEN_TO_FRONT "FRED"
  702.  
  703.  
  704. /*
  705.  ** Update the clips.
  706.  */
  707.  
  708. SETCLIP( "FREDVTBuffer", ToasterDV )
  709. SETCLIP( "FREDVTScaleOpt", ScaleOpt )
  710.  
  711. EXIT 0
  712.  
  713.  
  714. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  715. o_ SNIP     o_ SNIP     o_ SNIP     o_ SNIP     o_ SNIP     o_ SNIP     o_
  716. o\     SNIP o\     SNIP o\     SNIP o\     SNIP o\     SNIP o\     SNIP o\
  717. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  718.  
  719. /*
  720.  ** TestBCDAREXX.fred
  721.  **
  722.  ** $VER: TestBCDAREXX.fred 1.0.0 (20.12.94)
  723.  **
  724.  ** Also required is ADPro v2.5.0 (or higher).
  725.  **
  726.  ** Copyright 1994 SyntheToonz, Inc., Kenneth Jennings
  727.  ** All Rights Reserved
  728.  **
  729.  ** Internet: kenneth@daffy.aatech.com
  730.  **
  731.  ** This script can be run from the shell: rx ScriptTest.fred
  732.  ** or it can be called from FRED as part of a script list.
  733.  **
  734.  ** Prior to running this script from the CLI I had running:
  735.  **     1: ADPro 
  736.  **     2: FRED 
  737.  **     3: Video Toaster Switcher 
  738.  **     4: SANARexxHandler 
  739.  **     5: The GVR-S950 was initialized with SANSETUP.BAT
  740.  **         (And a previously striped tape was loaded)
  741.  **
  742.  ** Because we use the Toaster, we go out of our way to make 
  743.  ** sure we don't have any strange commodities or other toys
  744.  ** running on the system.
  745.  **
  746.  ** System in use: 
  747.  **     A2000, GVP 33MHz 040, 16M RAM
  748.  **     TBC II, TBC III, (neither one hooked to serial port)
  749.  **     SunRize AD516, (not running or active during tests)
  750.  **     425M Quantum (int), 105M Quantum (ext), 88M Syquest (ext)
  751.  ** 
  752.  ** NONE of the attempts to directly communicate with 
  753.  ** BCDAREXX.PORT in this script succeeded.  In other words 
  754.  ** NOTHING happened to the deck, but no error was returned to 
  755.  ** the REXX host.  The following command strings work when 
  756.  ** entered directly from a Shell/CLI:
  757.  **
  758.  ** 6.>rx "ADDRESS  BCDAREXX.PORT   INIT
  759.  ** 6.>rx "ADDRESS  BCDAREXX.PORT   INIT"
  760.  ** 6.>rx "ADDRESS 'BCDAREXX.PORT'  INIT"
  761.  ** 6.>rx "ADDRESS  BCDAREXX.PORT  'INIT'"
  762.  ** 6.>rx "ADDRESS 'BCDAREXX.PORT' 'INIT'"
  763.  */
  764.  
  765.  
  766. ADDRESS "ADPro"
  767. OPTIONS RESULTS
  768.  
  769. /* arguments are irrelavent for this script */
  770. PARSE ARG FrameNum FrameFName Length LoadFlag FirstCallSeq FirstCallCell
  771.  
  772.  
  773. RXPort = "BCDAREXX.PORT"
  774.  
  775.  
  776. SCREEN_TO_FRONT "FRED"
  777.  
  778.  
  779. /*
  780.  ** Now, try to get deck to do something.
  781.  ** INIT will just start rolling the tape and stop.
  782.  */
  783.  
  784. /* This works. TELLSAN is a CLI utility to send commands to the deck */
  785. address 'COMMAND' 'TELLSAN "INIT"'
  786. OKAY1 "One"
  787.  
  788. /* This does not work.*/
  789. ADDRESS BCDAREXX.PORT INIT
  790. OKAY1 "Two"
  791.  
  792. /* This works */
  793. ADDRESS 'COMMAND' 'RX "ADDRESS BCDAREXX.PORT INIT"'
  794. OKAY1 "Three"
  795.  
  796. /* This works */
  797. CmdString = RX '"'ADDRESS RXPort INIT'"'
  798. OKAY1 CmdString
  799. ADDRESS 'COMMAND' CmdString
  800. OKAY "Four"
  801.  
  802. /* This works */
  803. CmdString = RX '"'ADDRESS RXPort "INIT" '"'
  804. OKAY1 CmdString
  805. ADDRESS 'COMMAND' CmdString
  806. OKAY "Five"
  807.  
  808. /* None of the remaining examples work */
  809.  
  810. /* Show that ADPro is current */
  811. Adrs = ADDRESS()
  812. OKAY1 Adrs
  813.  
  814. /* Set New Address to BCDAREXX.PORT */
  815. ADDRESS VALUE RXPort 
  816. /* Show that BCDAREXX.PORT is current */
  817. Adrs = ADDRESS()
  818. ADDRESS "ADPro" OKAY1 '"'Adrs'"'
  819.  
  820. INIT
  821. ADDRESS "ADPro" OKAY1 "Six"
  822.  
  823. 'INIT'
  824. ADDRESS "ADPro" OKAY1 "Seven"
  825.  
  826. "INIT"
  827. ADDRESS "ADPro" OKAY1 "Eight"
  828.  
  829. /* Reset address to ADPro */
  830. ADDRESS
  831. Adrs = ADDRESS()
  832. OKAY1 Adrs
  833.  
  834. /* One Last test */
  835. CmdString = "ADDRESS" RXPort 'INIT'
  836. OKAY1 CmdString
  837. INTERPRET CmdString
  838. OKAY1 "Nine"
  839.  
  840.  
  841. EXIT 0
  842.  
  843.  
  844. /* ************ FINISH *********** */
  845.  
  846.